# This is a TOML-format file. For the spec, see https://github.com/toml-lang/toml#spec

# Secret key used to generate the CSRF token in the forms.
{% if env == 'staging' %}
secret_key = '{{ stg_anitya_secrect_key }}'
{% else %}
secret_key = '{{ anitya_secret_key }}'
{% endif %}

# The lifetime of the session, in seconds.
permanent_session_lifetime = 86400

{% if env == 'staging' %}
db_url = "postgresql://{{ anitya_stg_db_user }}:{{ anitya_stg_db_pass }}@{{ anitya_stg_db_host }}/{{ anitya_stg_db_name }}"
{% else %}
db_url = "postgresql://{{ anitya_db_user }}:{{ anitya_db_pass }}@{{ anitya_db_host }}/{{ anitya_db_name }}"
{% endif %}

# List of admins
anitya_web_admins = [
{% if env == 'staging' %}
  "7d183b09-d0d7-49e6-8ff3-fc2cce312cc0", # zlopez stg
{% else %}
  "5dd1b1f2-fee1-44f0-abeb-29df5bf151c7", # zlopez
  "5a11f015-54ee-4319-9092-39c427873575", # tibbs
  "42abdf74-b50e-49b4-a674-7cf01868d609", # kevin
{% endif %}
]

# The email to use in the 'From' header when sending emails.
admin_email = "admin@fedoraproject.org"

# The SMTP server to send mail through
smtp_server = "smtp.example.com"

# Whether or not to send emails to MAIL_ADMIN via SMTP_SERVER when HTTP 500
# errors occur.
email_errors = false

# List of users that are not allowed to sign in
blacklisted_users = []

librariesio_platform_whitelist = [
  'pypi',
  'rubygems',
]

social_auth_authentication_backends = [
  'social_core.backends.fedora.FedoraOpenId',
  'social_core.backends.open_id.OpenIdAuth',
]

# Default regular expression used for backend
default_regex = """\
              %(name)s(?:[-_]?(?:minsrc|src|source))?[-_]([^-/_\\s]+?)(?i)(?:[-_]\
              (?:minsrc|src|source|asc|release))?\\.(?:tar|t[bglx]z|tbz2|zip)\
              """

# Github access token
{% if env == 'staging' %}
github_access_token = "{{ github_stg_release_monitoring }}"
{% else %}
github_access_token = "{{ github_prod_release_monitoring }}"
{% endif %}

# Error threshold
check_error_threshold = 100

# Configurable links to package repositories for package mappings in distributions
# If you want to add any new distribution just add a new entry to this section
# %s will be filled in HTML template by the name of package mapping
[distro_mapping_links]
AlmaLinux = "https://git.almalinux.org/rpms/%s"
Fedora = "https://src.fedoraproject.org/rpms/%s"
PLD-Linux = "https://github.com/pld-linux/%s"
Ubuntu = "https://launchpad.net/ubuntu/+source/%s"

# The logging configuration, in dictConfig format.
[anitya_log_config]
version = 1
disable_existing_loggers = false

[anitya_log_config.formatters.simple]
format = "[%(asctime)s %(name)s %(levelname)s] %(message)s"

[anitya_log_config.handlers.console]
class = "logging.StreamHandler"
formatter = "simple"
stream = "ext://sys.stdout"

[anitya_log_config.loggers.anitya]
level = "INFO"
propagate = false
handlers = ["console"]

[anitya_log_config.loggers.fedmsg]
level = "INFO"
propagate = false
handlers = ["console"]

[anitya_log_config.root]
level = "INFO"
handlers = ["console"]
